/**
 * 
 */
package org.tq.test.lang.reflect;

import java.lang.reflect.Field;

/**
 * @title 		
 * @description	
 * @usage		
 * @company		上海微汇信息技术有限公司
 * @author		TQSUMMER
 * @create		2012-6-4 下午5:02:08
 */
/**
 * @author TQSUMMER
 */
public class ReflectBean {
	private String field1 = "1";
	public String field2 = "2";
	final public static String field3 = "3";

	/**
	 * @return the field1
	 */
	public String getField1() {
		return field1;
	}

	/**
	 * @return the field2
	 */
	public String getField2() {
		return field2;
	}

	/**
	 * @param field1
	 *            the field1 to set
	 */
	public void setField1(String field1) {
		this.field1 = field1;
	}

	/**
	 * @param field2
	 *            the field2 to set
	 */
	public void setField2(String field2) {
		this.field2 = field2;
	}

	public static void main(String[] args) {
		try {
			ReflectBean bean = new ReflectBean();
			Field field1 = ReflectBean.class.getDeclaredField("field3");
			System.out.println(field1.getModifiers() + "," + field1.get(bean));
		} catch (SecurityException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (NoSuchFieldException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IllegalArgumentException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IllegalAccessException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
